Page({
  data: {
    repairList: [],
  },
  onShow() {
    this.getRepairList()
  },
  /**获取维修列表 */
  async getRepairList() {
    // 请求数据接口
    const { data, code } = await wx.http.get('/repair')
    if (code !== 10000) return wx.utils.toast('获取个人维修列表失败')
    this.setData({
      repairList: data.rows,
    })
    console.log(this.data.repairList)
  },
  goDetail(ev) {
    wx.navigateTo({
      url: '/repair_pkg/pages/detail/index?id=' + ev.mark.id,
    })
  },
  addRepair() {
    wx.navigateTo({
      url: '/repair_pkg/pages/form/index',
    })
  },
})
